<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-02 19:42:06
 * @LastEditTime: 2022-03-08 09:30:03
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Repositories;

use App\Models\Barcode;
use App\Models\Table;
use App\Models\TableButton;
use App\Models\TableColumn;
use App\Models\TableReport;

class BarcodeRepositorie extends Repositories
    {
    public $relation_models = ["creator", "updator","company","material"];
    public function boot(Barcode $model)
        {
        $this->model = $model;
        }

    public function fuzzySearch($value)
        {
        $value = trim($value);
        $this->where(function ($query) use ($value)
            {
            $query->orWhere("name", "like", "%{$value}%");
            $query->orWhere("code", "like", "%{$value}%");
            });
        }
}
